package output;

import javax.imageio.IIOException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileOutputStreamDemo4 {
    public static void main(String[] args) {
        try(FileOutputStream fos=new FileOutputStream("G:\\Javatest2\\output\\c.txt",true);){
            fos.write("abcde".getBytes());
        }catch (IOException e){
            e.printStackTrace();
        }
        try(Demo d=new Demo();){

        }catch (Exception e){

        }
    }
}
class Demo implements AutoCloseable{
    @Override
    public void close() throws Exception{
        System.out.println("我自动关闭了");
    }
}
